Skip to content

Conversation

james-elicx
Copy link
Collaborator

When passing the --remote flag to our preview command, it would fail to properly populate the cache due to not targeting the remote bindings and missing a --preview flag for Workers KV / D1.

fixes #887

Changes:

  • Support both remote and local as modes for cache population in the preview command.
  • Pass the preview flag for KV / D1 cache population for the preview command.

Tested that cache population was working as expected with the following commands for the d1-tag-next example:

  • opennextjs-cloudflare preview --config wrangler.e2e.jsonc
  • opennextjs-cloudflare preview --config wrangler.e2e.jsonc --remote
  • opennextjs-cloudflare deploy --config wrangler.e2e.jsonc

Copy link

changeset-bot bot commented Sep 13, 2025

🦋 Changeset detected

Latest commit: d0cff66

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Sep 13, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@888

commit: d0cff66

@vicb
Copy link
Contributor

vicb commented Sep 15, 2025

Thanks for the fix @james-elicx

@dario-piotrowicz could you please take a look as you worked on the remote bindings.

Copy link
Contributor

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🙂

Although, tangential to the changes here, long term I would say that ideally remote bindings should be used instead of running the worker with --remote (unless there's a benefit/reason to do so?)

@vicb
Copy link
Contributor

vicb commented Sep 16, 2025

Although, tangential to the changes here, long term I would say that ideally remote bindings should be used instead of running the worker with --remote (unless there's a benefit/reason to do so?)

I think the plan is to remove --remote is the next major of wrangler @dario-piotrowicz right?

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@james-elicx I added a few minor comments.

The one most important thing is to add the "r" alias for "remote" IMO.

Thanks!

@james-elicx james-elicx requested a review from vicb September 18, 2025 08:06
@vicb
Copy link
Contributor

vicb commented Sep 22, 2025

Sorry for the delay in the review, please see my comments.
The PR looks ready to go soon.
Thanks for your work on this James!

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks James!

@james-elicx james-elicx merged commit 51322a8 into main Sep 22, 2025
7 checks passed
@james-elicx james-elicx deleted the james/remote-preview branch September 22, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] preview cli doesn't --preview flag to wrangler command

3 participants